package com.zhuyuan.security.service;

import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * @Author: 张琳凯
 * @Description: UserDetailsService基类
 * 增加：
 * 1. 通过手机号查询用户信息
 * 2. 通过第三方openid查询用户信息
 * @DateTime: 2025/1/9 21:51
 **/
public interface BaseUserDetailsService extends UserDetailsService {
    /**
     * 根据手机号登录
     *
     * @param mobile
     * @return UserDetails
     */
    UserDetails loadUserByMobile(String mobile) throws UsernameNotFoundException;


    /**
     * 根据社交账号登录
     *
     * @param openId 第三方的绑定的openId
     */
    UserDetails loadUserBySocial(String openId) throws UsernameNotFoundException;
}
